Hi,
I'm trying to implement a login action, and I have a problem to check the password. here is the code:
$username = $this->request->getPost('username');
$userpass = $this->request->getPost('userpass');
$user = User::findFirstByUsername($username);
if($this->request->isPost())
{
if($user)
{
if($this->security->checkHash($userpass, $user->userpass))
{
$this->flash->success('You have logged in successfully.');
}
}
else
{
foreach($user->getMessages() as $message)
{
$this->flash->error((string) $message);
}
}
}
the function $this->security->checkHash($userpass, $user->userpass) is always return false.